package yxy.game.pm2.module.union.war;

import org.joda.time.DateTime;

import yxy.game.pm2.module.union.rank.UnionRankModule;

//单个联盟内用户排名
public class RankUnionWar extends UnionRankModule {
	private String unionCode;

	public RankUnionWar(String unionCode) {
		this.unionCode = unionCode;
		initInfo();
	}

	@Override
	protected String rankKey() {
		return String.format("UNION:%s:MODULE:WARRANK", unionCode);
	}

	@Override
	public String rankName() {
		return "WARRANK";
	}

	@Override
	protected boolean reconsitution() {
		return false;
	}

	@Override
	protected long valuePlastic(long value) {
		return value * 10000000000L + (10000000000L - DateTime.now().getMillis() / 1000);// 10位时间戳长度
	}

	@Override
	protected long valueRestore(long score) {
		return score / 10000000000L;
	}

}
